import { PlayerDialog } from "./PlayerDialog";
import { GTextFormat } from "../../../../common/GTextFormat";
import { FontUtil } from "../../../../common/font/FontUtil";
import { FilterConst } from "../../../../component/gconst/FilterConst";
import { Language } from "../../../../../extend/language/Language";
import { GuildTaskInfo } from "../../../model/GuildTaskInfo";
//class GuildTaskCount
    
    export  class GuildTaskCount extends PlayerDialog
    {
        constructor()
        {
            super();
            mouseEnabled = false;
            mouseChildren = false;
            this.initUI();
            return;
        }

        /* internal  */initUI(): void
        {
            this._cycleCount = new Object /* flash.text.TextField */();
            this._cycleCount.selectable = false;
            this._cycleCount.autoSize = flash.text.TextFieldAutoSize.LEFT;
            this._cycleCount.defaultTextFormat = new GTextFormat(FontUtil.songtiName, 12, 48895, true);
            this._cycleCount.filters = [FilterConst.nameGlowFilter];
            this._cycleCount.x = 0;
            this._cycleCount.width = 120;
            addChild(this._cycleCount);
            this._loopCount = new Object /* flash.text.TextField */();
            this._loopCount.selectable = false;
            this._loopCount.autoSize = flash.text.TextFieldAutoSize.LEFT;
            this._loopCount.defaultTextFormat = new GTextFormat(FontUtil.songtiName, 12, 48895, true);
            this._loopCount.filters = [FilterConst.nameGlowFilter];
            this._loopCount.x = 100;
            this._loopCount.width = 120;
            addChild(this._loopCount);
            return;
        }

        public /* override */ updateData(arg1: Array<any>): void
        {
            this._taskInfo = arg1[0];
            this._cycleCount.text = Language.getString(20510) + "：" + this._taskInfo.cycleCount + "/" + this._taskInfo.maxCycleCount;
            this._loopCount.text = Language.getStringByParam(20519, this._taskInfo.loopCount + "/" + this._taskInfo.maxLoopCount);
            super.updateData(arg1);
            return;
        }

        public /* override */ dispose(): void
        {
            super.dispose();
            this._taskInfo = null;
            return;
        }

        /* internal */ /* var */_cycleCount: Object /* flash.text.TextField */;

        /* internal */ /* var */_loopCount: Object /* flash.text.TextField */;

        /* internal */ /* var */_taskInfo: GuildTaskInfo;
    }
